Python 3.8.6rc1 (tags/v3.8.6rc1:08bd63d, Sep  7 2020, 23:10:23) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> data = [1,3,4,5,6,7]
>>> data[0]
1
>>> data[-1]
7
>>> data[-2]
6
>>> range(0,6)
range(0, 6)
>>> list(range(6))
[0, 1, 2, 3, 4, 5]
>>> list(range(9,0,-2))
[9, 7, 5, 3, 1]
>>> a = "laoyou is teachers"
>>> b =  list(a)
>>> b
['l', 'a', 'o', 'y', 'o', 'u', ' ', 'i', 's', ' ', 't', 'e', 'a', 'c', 'h', 'e', 'r', 's']
>>> b[0:6]
['l', 'a', 'o', 'y', 'o', 'u']
>>> b[7:9]
['i', 's']
>>> b[-1:-8]
[]
>>> b[-8:-1]
['t', 'e', 'a', 'c', 'h', 'e', 'r']
>>> b[-7:]
['e', 'a', 'c', 'h', 'e', 'r', 's']
>>> b[-9:-1]
[' ', 't', 'e', 'a', 'c', 'h', 'e', 'r']
>>> b[-8:]
['t', 'e', 'a', 'c', 'h', 'e', 'r', 's']
>>> b[3:]
['y', 'o', 'u', ' ', 'i', 's', ' ', 't', 'e', 'a', 'c', 'h', 'e', 'r', 's']
>>> b[::2]
['l', 'o', 'o', ' ', 's', 't', 'a', 'h', 'r']
>>> b[::]
['l', 'a', 'o', 'y', 'o', 'u', ' ', 'i', 's', ' ', 't', 'e', 'a', 'c', 'h', 'e', 'r', 's']
>>> b[19:3:-2]
['s', 'e', 'c', 'e', ' ', 'i', 'u']
>>> #起始值要比结束值要大（正序）；起始值要比结束值大（逆序）；结束值减一
>>> 
>>> 
>>> #b[0:6] = b[0:6:1]
>>> 
>>> b[0:6]
['l', 'a', 'o', 'y', 'o', 'u']
>>> .join(b[0:6])
SyntaxError: invalid syntax
>>> join(b[0:6])
Traceback (most recent call last):
  File "<pyshell#28>", line 1, in <module>
    join(b[0:6])
NameError: name 'join' is not defined
>>> ''join(b[0:6])
SyntaxError: invalid syntax
>>> ''.join(b[0:6])
'laoyou'
>>> ''.join(b[-8:])
'teachers'
>>> ''.join(b[10:17])
'teacher'
>>> ''.join(b[10:])
'teachers'
>>> #到末尾直接给结束值
>>> #还是从0开始数
>>> #列表切片